package com.inctech.clz2.test1;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;

public class ThirdQuestion {
	public boolean isSunday(String m, int n) throws ParseException{
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		Date date = sdf.parse(m);
		Calendar cal = Calendar.getInstance();
		cal.setTime(date);
		cal.set(cal.get(Calendar.YEAR), cal.get(Calendar.MONTH),cal.get(Calendar.DAY_OF_YEAR)+n);
		if(1 == cal.get(Calendar.DAY_OF_WEEK)){
			return true;
		}else{
			return false;
		}
		
	}
}
